5
5
.
.
1
1
4
4
.
.
m
m
a
a
s
s
k
k
I
I
n
n
f
f
o
o
[
[
R
R
]
]
.mask displays a secondary View in front of the Parent View masking Parent's content.
This means that Parent's content will only be seen through the Mask View where Mask View has some content.
Syntax
.mask(Text("SWIFT").font(Font.system(size: 72).weight(.black)).frame(alignment: .center).border(Color.red,
width: 50))
E
E
x
x
a
a
m
m
p
p
l
l
e
e
Example
struct ContentView: View {
var body: some View {
Image("Table").resizable().frame(width: 300, height: 300)
.mask(Text("SWIFT").font(Font.system(size: 72).weight(.black)).frame(alignment:
.center).border(Color.red, width: 50))
}
}
Output